package com.tao.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName submittable
 */
@TableName(value ="submittable")
@AllArgsConstructor
@NoArgsConstructor
public class Submittable implements Serializable {
    /**
     * 主键ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 提问者id
     */
    private Long qid;

    /**
     * 回答者id
     */
    private Long aid;

    /**
     * 内容
     */
    private String content;

    /**
     * 逻辑删除
     */
    @TableLogic
    private Boolean deleted;

    /**
     * 积分
     */
    private Integer rank;

    /**
     * 提交状态
     */
    private Integer status;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date submittime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    public Long getId() {
        return id;
    }

    /**
     * 主键ID
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 提问者id
     */
    public Long getQid() {
        return qid;
    }

    /**
     * 提问者id
     */
    public void setQid(Long qid) {
        this.qid = qid;
    }

    /**
     * 回答者id
     */
    public Long getAid() {
        return aid;
    }

    /**
     * 回答者id
     */
    public void setAid(Long aid) {
        this.aid = aid;
    }

    /**
     * 内容
     */
    public String getContent() {
        return content;
    }

    /**
     * 内容
     */
    public void setContent(String content) {
        this.content = content;
    }

    /**
     * 逻辑删除
     */
    public Boolean getDeleted() {
        return deleted;
    }

    /**
     * 逻辑删除
     */
    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    /**
     * 积分
     */
    public Integer getRank() {
        return rank;
    }

    /**
     * 积分
     */
    public void setRank(Integer rank) {
        this.rank = rank;
    }

    /**
     * 提交状态
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * 提交状态
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * 更新时间
     */
    public Date getSubmittime() {
        return submittime;
    }

    /**
     * 更新时间
     */

    public void setSubmittime(Date submittime) {
        this.submittime = submittime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Submittable other = (Submittable) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getQid() == null ? other.getQid() == null : this.getQid().equals(other.getQid()))
            && (this.getAid() == null ? other.getAid() == null : this.getAid().equals(other.getAid()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
            && (this.getRank() == null ? other.getRank() == null : this.getRank().equals(other.getRank()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getSubmittime() == null ? other.getSubmittime() == null : this.getSubmittime().equals(other.getSubmittime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getQid() == null) ? 0 : getQid().hashCode());
        result = prime * result + ((getAid() == null) ? 0 : getAid().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        result = prime * result + ((getRank() == null) ? 0 : getRank().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getSubmittime() == null) ? 0 : getSubmittime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", qid=").append(qid);
        sb.append(", aid=").append(aid);
        sb.append(", content=").append(content);
        sb.append(", deleted=").append(deleted);
        sb.append(", rank=").append(rank);
        sb.append(", status=").append(status);
        sb.append(", submittime=").append(submittime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}